package tmproject.hlhj.fhp.cartrans.customVIews

import android.content.Context
import android.text.InputFilter
import android.util.AttributeSet
import android.widget.EditText
import tmproject.hlhj.fhp.cartrans.R

/**
 * Created by Never Fear   on 2018\9\4 0004.
Never More....
 */
class MyEditText :EditText{
    @JvmOverloads
    constructor(context:Context,attributeSet: AttributeSet?=null,deff:Int=0):super(context,attributeSet,deff){
        val styledAttributes = context.obtainStyledAttributes(attributeSet, R.styleable.MyEditText)
        styledAttributes?.let {
            val int = it.getInt(R.styleable.MyEditText_limit, 100)
            this.filters= arrayOf<InputFilter>(InputFilter.LengthFilter(int))
        }
    }
}